package com.zmhz.intercept;

import java.util.Date;

import com.eova.aop.AopContext;
import com.eova.aop.MetaObjectIntercept;
import com.eova.common.utils.xx;
import com.jfinal.ext.kit.DateKit;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Record;

public class SupplyInterceptor extends MetaObjectIntercept {

	
	 public void addInit(AopContext ac) throws Exception {
		 String userid = ac.fixed.getStr("userid");
		 String sql = "select frontusers.phone as phone,users_info.province as province,users_info.city as city,users_info.address as address from (frontusers join users_info) where  frontusers.id =users_info.userid and frontusers.id = ?";
		 Record record = Db.findFirst(sql,userid);
		 
		 ac.fixed.set("phone", record.get("phone"));
		 ac.fixed.set("province", record.get("province"));
		 ac.fixed.set("city", record.get("city"));
		 ac.fixed.set("address", record.get("address"));
		
	    }
}
